<template>
	<view class="wrapper">
		<view class="wrapperItem" @tap="changeInfo(index)" @longtap="deleteSelectGood(index)" v-for="(item,index) in OrderGoodsList" :key="index">
			<view class="title">
				商品名称:{{item.GoodsName}}
			</view>
			<view class="temp">
				编号:{{item.GoodsCode}}
			</view>
			<view class="temp">
				<view class="flex_one">
					
					<text class="red">
						￥{{item.Price | onlyTwoFloat}}
					</text>
					x{{item.Qty | onlyTwoFloat}}
				</view>
				<view>
					￥{{item.Amount | onlyTwoFloat}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				
			}
		},
		filters: {
			onlyTwoFloat(value) {
				if(typeof value == 'underfind' || value == ''){
					return value; 
				}
				return Math.round(parseFloat(value * 1000)) / 1000
			}
		},
		props: ['OrderGoodsList'],
		methods:{
			deleteSelectGood(index) {
				this.$emit('deleteSelectGood', {
					currentTarget:{
						detail:{
							deleteIndex: index
						}
					}
				})
			},
			changeInfo(index) {
				this.$emit('changeInfo', {
					currentTarget:{
						detail:{
							changeIndex: index
						}
					}
				})
			},
		}	
	}
</script>

<style scoped>
	.wrapper{
		width: 100%;
		padding-top: 8px;
	}
	.wrapper .wrapperItem{
		width: 95%;
		/* padding-bottom: 8px; */
		margin: auto;
		background: #FFF;
		box-sizing: border-box;
		padding-left: 20upx;
		padding-right: 20upx;
		margin-bottom: 10upx;
		border-radius: 4upx;
		box-shadow: 2px 2px 5px #ebebeb;
	}
	.wrapper .wrapperItem .title{
		width: 100%;
		height: 50upx;
		line-height: 50upx;
		font-size: 30upx;
		font-weight: bold;
	}
	.wrapper .wrapperItem .temp{
		width: 100%;
		height: 50upx;
		line-height: 50upx;
		font-size: 26upx;
		display: flex;
	}
	.wrapper .wrapperItem .temp view.flex_one{
		flex: 1;
	}
	.red{
		color: red;
		padding-right: 4px;
	}
</style>
